package cn.codehaus.core.common.dao;

import java.util.List;

public interface BaseHibernateDao<T> {

	T save(T domain);

	T saveOrUpdate(T domain);

	T update(T instance);

	boolean delete(T domain);

	boolean delete(List<T> domainList);

	int getCount();

	int getCount(String propertyName, Object value);

	T findById(Integer id);

	List<T> findByExample(Object value);

	List<T> findByExample(String entityName, Object value);

	List<T> findIn(String propertyName, Object[] value);

	List<T> findByProperty(String propertyName, Object value);

	List<T> findByProperty(String[] propertyNames, Object[] values);

	List<T> fuzzyFindByProperty(String propertyName, Object value);

	List<T> findByProperty(String propertyName, final Object value,
			final int firstResult, final int size);

	List<T> findAll();

	List<T> findAll(final int firstResult, final int size);

	String getOrderPropertyName();

	void setOrderPropertyName(String orderPropertyName);

	boolean isDESC();

	void setDESC(boolean isDESC);

}